package gu;

import java.util.Scanner;

public class main2 
{
	 public static void main(String[] args)
	 {
  
		Scanner in = new Scanner(System.in);
        while(in.hasNextLine())
        {
	      String a = in.nextLine();
	      int b= Integer.parseInt(a);
            if(b<=20000&&b>=10000)
             {
            	 System.out.print(Integer.toBinaryString(b)+",");
                 System.out.print(Integer.toOctalString(b)+",");
                 System.out.println(Integer.toHexString(b));
             }   
            else{
            	String c =a.replaceAll("-","");
            	int sum = 0;
            	StringBuilder sb=new StringBuilder();
            	
        
        		for(int i = 0; i < c.length(); i++){
        			String item = c.substring(i, i+1);
        			sb.append(item).append(" ");
        			sum += Integer.parseInt(item);
        		}
        		
        		System.out.println(sb.substring(0, sb.length() -1)+" "+sum  );
        	
            }
            	 
       }
	 }
}

